<!--
* @description 警情场所
* @author zywu
* @date 2021/04/29 14:58:11
!-->
<template>
  <el-row class="firealarm-place-info" :gutter="10" style="overflow-y:auto;">
    <el-col :span="24" class="d-flex cell-col">
      <div class="cell-title">业主名称：</div>
      <div class="cell-value">{{dataInfo.name}}</div>
    </el-col>
    <el-col :span="12" class="d-flex cell-col">
      <div class="cell-title">业主联系人：</div>
      <div class="cell-value">{{dataInfo.contact}}</div>
    </el-col>
    <el-col :span="12" class="d-flex cell-col">
      <div class="cell-title">业主联系电话：</div>
      <div class="cell-value">
        <el-button type="text">{{dataInfo.tel}}</el-button>
      </div>
    </el-col>
    <el-col :span="24" class="d-flex cell-col">
      <div class="cell-title">物业名称：</div>
      <div class="cell-value">{{dataInfo.manager}}</div>
    </el-col>
    <template v-for="(item,i) in dataInfo.contacts">
      <el-col :span="6" class="d-flex cell-col" :key="item.name+i">
        <div class="cell-title">安全责任人：</div>
        <div class="cell-value">{{item.name}}</div>
      </el-col>
      <el-col :span="6" class="d-flex cell-col" :key="item.phone+i">
        <div class="cell-title">责任人电话：</div>
        <div class="cell-value">
          <el-button type="text">{{item.phone}}</el-button>
        </div>
      </el-col>
    </template>
    <template v-for="(item,i) in dataInfo.contacts">
      <el-col :span="6" class="d-flex cell-col" :key="item.name+i+dataInfo.contacts.length">
        <div class="cell-title">安全管理人：</div>
        <div class="cell-value">{{item.name}}</div>
      </el-col>
      <el-col :span="6" class="d-flex cell-col" :key="item.phone+i+dataInfo.contacts.length">
        <div class="cell-title">管理人电话：</div>
        <div class="cell-value">
          <el-button type="text">{{item.phone}}</el-button>
        </div>
      </el-col>
    </template>
    <el-col :span="24" class="d-flex cell-col">
      <div class="cell-title">维保公司：</div>
      <div class="cell-value">{{dataInfo.maintainCompanyName}}</div>
    </el-col>
    <template v-for="(item,i) in maintenanceUserList">
      <el-col :span="6" class="d-flex cell-col" :key="item.name+i+maintenanceUserList.length">
        <div class="cell-title">维保人员：</div>
        <div class="cell-value">{{item.name}}</div>
      </el-col>
      <el-col :span="6" class="d-flex cell-col" :key="item.phone+i+maintenanceUserList.length">
        <div class="cell-title">维保人员电话：</div>
        <div class="cell-value">
          <el-button type="text">{{item.phone}}</el-button>
        </div>
      </el-col>
    </template>
    <el-col :span="24" class="d-flex cell-col">
      <div class="cell-title">所属消防队：</div>
      <div class="cell-value">{{dataInfo.belongsFireBrigade}}</div>
    </el-col>
    <el-col :span="24" class="d-flex cell-col">
      <div class="cell-title">消防队电话：</div>
      <div class="cell-value">
        <el-button type="text">{{dataInfo.belongsFireBrigadeMobile}}</el-button>
      </div>
    </el-col>
  </el-row>
</template>

<script>
import { getFullInfoExt } from '@/api/org'
import { getHaveOrgUserList } from '@/api/maintence'
export default {
  props: {
    dataObj: {
      type: Object,
      default: function () {
        return {}
      },
    },
  },
  data() {
    return {
      dataInfo: {},
      maintenanceUserList: [],
    }
  },

  components: {},

  computed: {},

  created() {
    getFullInfoExt({ organizationId: this.dataObj.unitId }).then((res) => {
      this.dataInfo = res.data
    })
    this.getMaintenanceUser()
  },

  mounted() {},

  methods: {
    getMaintenanceUser() {
      getHaveOrgUserList({
        orgIds: this.dataObj.unitId,
        roleIds: '185,184,183',
      }).then((res) => {
        if (res.status === 200) {
          this.maintenanceUserList = res.data.length > 0 ? res.data : []
        }
      })
    },
  },
}
</script>
<style lang='scss'>
</style>